package com.demo.delivery.utils;

import android.app.Activity;

import androidx.fragment.app.Fragment;

import com.demo.delivery.R;
import com.gyf.immersionbar.ImmersionBar;

public class ImmersionBarUtils {

    /**
     * 沉浸式状态栏
     */
    public static void immersion(Activity activity, boolean statusBarDarkFont) {
        ImmersionBar.setStatusBarView(activity, activity.findViewById(R.id.v_status_bar));
        ImmersionBar.with(activity).statusBarDarkFont(statusBarDarkFont).init();
    }

    public static void immersion(Fragment fragment, boolean statusBarDarkFont) {
        ImmersionBar.setStatusBarView(fragment, fragment.getView().findViewById(R.id.v_status_bar));
        ImmersionBar.with(fragment).statusBarDarkFont(statusBarDarkFont).init();
    }

}
